# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ktexteditor
pkgver=5.73.0
pkgrel=0
pkgdesc="Advanced embeddable text editor"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND (LGPL-2.0-only OR LGPL-3.0-only)"
depends_dev="karchive-dev kconfig-dev kguiaddons-dev ki18n-dev kio-dev kparts-dev sonnet-dev kiconthemes-dev syntax-highlighting-dev kauth-dev"
makedepends="$depends_dev extra-cmake-modules qt5-qttools-dev doxygen"
checkdepends="xvfb-run"
options="!check" # fail on builders
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/ktexteditor-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="61ebffb30c22c136c5e5cb32b0ac2dcdd73ad546c22aeec7ed97e257cc2ebcab4eae2e83f3ca9d897747bbd675e7bb3a6f2b777d0c4a76f4ed035b13aa8581b7  ktexteditor-5.73.0.tar.xz"
